import { useSelector, useDispatch } from "react-redux";
import { increment, decrement } from "@/redux/counter";
import { Button } from "antd";

export default function Home() {
  const count = useSelector((state) => state.counter.value);
  const dispatch = useDispatch();

  return (
    <div>
      <Button type="primary" onClick={() => dispatch(increment())}>
        Increment
      </Button>
      <span>{count}</span>
      <Button type="primary" onClick={() => dispatch(decrement())}>
        Decrement
      </Button>
    </div>
  );
}
